﻿using System.Collections.Generic;
using System.Runtime.Serialization;

namespace soma.Models.Resources
{
    [DataContractAttribute]
    public class MessageResource : Resource
    {
        [DataMemberAttribute]
        public string Message { get; set; }

        public MessageResource(string id, string tag)
        {
            this.Id = id;
            this.Tag = tag;

            Links = new List<Link>();
            Links.Add(new Link("linkrels/resources/messages/delete", "/resources/messages/?tag=" + tag + "&id=" + id));
        }

        public override bool Equals(object obj)
        {
            return this.GetHashCode().Equals(obj.GetHashCode());
        }

        public override int GetHashCode()
        {
            return Id.GetHashCode();
        }
    }
}